package com.linzelin.mapper;

import com.linzelin.po.User;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

public class UserMapperImpl implements UserMapper {

    private UserMapper mapper;

    public UserMapperImpl(SqlSessionTemplate sqlSessionTemplate) {
        mapper = sqlSessionTemplate.getMapper(UserMapper.class);
    }

    @Override
    public List<User> selectUser() {
        User user = new User(7, "柒", "123");
        insertUser(user);


        deleteUser(7);


        return mapper.selectUser();
    }

    @Override
    public int insertUser(User user) {
        return mapper.insertUser(user);
    }

    @Override
    public int deleteUser(int id) {
        return mapper.deleteUser(id);
    }

    @Override
    public int updateUser(User user) {
        return updateUser(user);
    }
}
